<?php
/**
 * 顶部导航栏
 * @link https://www.kancloud.cn/cleverstone/ymb2
 * @copyright Copyright (c) 2020 Yii Manager Software LLC
 */

use builder\helper\Url;
use backend\widgets\assets\Nav;
use builder\helper\H5;

/* @var $this \yii\web\View */

Nav::register($this);
/** @var \common\models\Admin $user */
$user = Yii::$app->user->identity;
?>
<div ng-controller="ym2.ctrl.public.nav" class="pl-180 ym2-top-nav layui-bg-gray h-40 clearfix">
    <!--左-->
    <ul class="layui-nav layui-bg-gray float-left">
        <li ym2-kb-accordion class="layui-nav-item cursor-pointer pr-15" ng-click="toggleCollapse()">
            <i ng-if="!collapseShrink" class="layui-icon layui-icon-shrink-right f16" title="隐藏菜单"></i>
            <i ng-if="collapseShrink" class="layui-icon layui-icon-spread-left f16" title="展开菜单"></i>
        </li>
        <li class="my-breadcrumb cursor-pointer pr-15" aria-label="breadcrumb">
            <!--面包屑导航-->
            <?= H5::getViewBreadcrumb() ?>
        </li>
        <!--<li class="layui-nav-item cursor-pointer layui-this">
           <a href="#">项目1</a>
       </li>-->
    </ul>

    <!--右-->
    <ul class="layui-nav layui-bg-gray float-right">
        <!--站内信-->
        <!--<li class="layui-nav-item cursor-pointer mr-3">
            <a title="站内信">
                <sup class="rounded-circle layui-bg-red" style="width:8px;height:8px;display:inline-block;"></sup>
                <span class="bi bi-bell f17"></span>
            </a>
            <div class="layui-nav-child layui-nav-child-r layui-anim-downbit rounded-8 w-350">
                <div class="px-3">
                    消息内容
                </div>
            </div>
        </li>-->
<?php if (!$user->mobile || !$user->email): ?>
        <!--完善信息-->
        <li class="layui-nav-item">
            <a class="layui-font-red" title="完善个人信息" href="/home/account?ref=complete_user_info" target="_self">
                个人信息待完善
                <sup class="layui-badge-dot" style="margin: -10px 0 0;"></sup>
            </a>
        </li>
<?php endif; ?>
        <!--应用版本-->
        <li class="layui-nav-item">
            <a class="px-0" title="应用版本" href="/changelog.htm" target="_blank">
                <span style="color: #ff9800;" class="bi bi-rocket-takeoff f16"></span><span><?= \builder\helper\App::params('admin.appVersion') ?></span>
            </a>
        </li>
        <li class="layui-nav-item">
            <a class="cp" title="安装桌面快捷方式">
                <i class="bi bi-windows f14"></i>
                <span>桌面版</span>
            </a>
            <div class="layui-nav-child layui-nav-child-r layui-anim-downbit rounded-8">
                <div class="layui-card box-shadow-none">
                    <div class="layui-card-body">
                        <h2><b class="f15 layui-font-black">谷歌、360、Microsoft Edge浏览器中：</b></h2>
                        <img src="/media/image/nav/google_browser_shortcut_guide.png" width="300" alt>
                        <div style="line-height: 30px;">
                            <p>1、官网下载指定浏览器。</p>
                            <p>2、打开浏览器，并在地址栏中输入网址，登录后台。</p>
                            <p>3、如上图所示，点击浏览器右上角地址栏中安装图标，即可生成桌面快捷入口。</p>
                        </div>
                    </div>
                </div>
            </div>
        </li>
        <!--快捷键-->
        <li class="layui-nav-item">
            <a class="cp" title="键盘快捷键">
                <i class="bi bi-keyboard f22"></i>
            </a>
            <div class="layui-nav-child layui-nav-child-r layui-anim-downbit rounded-8">
                <div class="layui-card box-shadow-none">
                    <div class="layui-card-body">
                        <h2><b class="f15 layui-font-black">键盘快捷键</b></h2>
                        <ul class="list-group w-200" style="line-height: 30px;">
                            <li class="list-group-item p-0 border-0 d-flex justify-content-between">
                                <span>窗口全屏</span>
                                <b>F11</b>
                            </li>
                            <li class="list-group-item p-0 border-0 d-flex justify-content-between">
                                <span>侧边菜单隐藏/显现</span>
                                <b>F2</b>
                            </li>
                            <li class="list-group-item p-0 border-0 d-flex justify-content-between">
                                <span>关闭弹窗（模态框）</span>
                                <b>Esc</b>
                            </li>
                        </ul>
                    </div>
                </div>
            </div>
        </li>
        <!--个人中心-->
        <li class="layui-nav-item">
            <a title="个人中心" href="javascript:;">
                <span class="layui-icon layui-icon-home f19"></span>
            </a>
            <dl class="layui-nav-child layui-nav-child-r layui-anim-downbit rounded-8">
                <dd class="cursor-pointer">
                    <a class="pl-4 pr-5 d-flex align-items-center" href="<?= Url::to('home/account', '') ?>">
                        <span class="bi bi-gear f17"></span>
                        <span class="pl-2">账号设置</span>
                    </a>
                </dd>
                <dd>
                    <div class="dropdown-divider"></div>
                </dd>
                <dd class="cursor-pointer">
                    <a class="pl-4 pr-5 d-flex align-items-center layui-font-red" href="<?= Url::to(['/site/quit', 'referrer' => Url::current()], '') ?>">
                        <span class="bi bi-power f18"></span>
                        <span class="pl-2">退出账号</span>
                    </a>
                </dd>
            </dl>
        </li>

        <!--窗口全屏-->
        <li class="layui-nav-item cursor-pointer ym2AppScreen">
            <a ym2-bootstrap-plugin="tooltip" data-toggle="tooltip" data-placement="bottom" title="如需绑定全屏请按【F11】">
                <span class="bi bi-arrows-fullscreen f16"></span>
            </a>
        </li>
    </ul>
</div>
